<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;

/**
 * @property bool $is_good 精选:0=否,1=是
 * @property float $latitude 纬度
 * @property float $longitude 经度
 * @property int $browse 浏览数量
 * @property int $collect 收藏数
 * @property int $comment 评论数
 * @property int $deletetime
 * @property int $hot 热度
 * @property int $id
 * @property int $like 点赞数
 * @property int $users_id
 * @property string $adcode
 * @property string $address 地址
 * @property string $content 内容
 * @property string $createtime
 * @property string $images 图片
 * @property string $tags_ids 标签
 * @property string $title 标题
 * @property-read \app\model\Users $users
 * @property-read \app\model\UsersCollect $users_collect
 * @property-read \app\model\UsersFollow $users_follow
 * @property-read \app\model\UsersLike $users_like
 * @method static \think\db\Query onlyTrashed()
 * @method static \think\db\Query withTrashed()
 * @mixin \think\Model
 */
class Forum extends Model
{
    use SoftDelete;
    protected $deleteTime = 'deletetime';
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    public function users()
    {
        return $this->belongsTo(Users::class, 'users_id');
    }

    public function usersCollect()
    {
        return $this->hasOne(UsersCollect::class,'pro_id');

    }

    public function usersLike()
    {
        return $this->hasOne(UsersLike::class,'pro_id');
    }

    function usersFollow()
    {
        return $this->hasOne(UsersFollow::class,'to_users_id','users_id');
    }



}
